import Vue from 'vue'
import Element from 'element-ui'
import App from './App'
import store from './store'
import router from './routers'
import * as filters from './filters'
import plugIn from './utils/plugIn'
import uploader from 'vue-simple-uploader'
import echarts from 'echarts'
import echartsTheme from './assets/echartsTheme'
import moment from "vue-moment"
import { Transfer,Table,Switch } from 'ant-design-vue';
import Pagination from './components/Pagination/index.vue'
import 'ant-design-vue/dist/antd.css';

import '@/assets/iconfont/iconfont.js'
import '@/assets/iconfont/iconfont3.js'
import './styles/element-variables.scss'
import '@/styles/index.scss'
import './permission'
import './icons'

import permission from  './directive/permission'


Element.Dialog.props.closeOnClickModal.default=false;

Vue.component('pagination', Pagination)

Vue.use(permission)
Vue.use(uploader)

Vue.use(Transfer)
Vue.use(Table)
Vue.use(Switch)

Vue.use(Element, { size: 'small' })
Vue.use(plugIn)
Vue.use(moment)
echarts.registerTheme('echartsTheme', echartsTheme)

_.templateSettings = {
  interpolate: /\{(.+?)\}/g
}

Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

export const dispatch = new Vue();

new Vue({
  el: '#root',
  router,
  store,
  render: h => h(App)
})
